package com.nzd.slsharing.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
//用于返回前端
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDto {
    private Integer id;
    private String username;
    private String gender;
    private String studentId;
    private Integer age;
    private String headSculpture;
    private Integer userRole;
    private String email;
    private String school;
    private String signature;
    private String phone;
    //用户token
    @JsonProperty("Authorization")
    private String Authorization;
    // 数据库timestamp类型时间转化java规定格式时间
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    // 接受前端表单传递过来的字符串类型的时间数
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;


}
